import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
  history: createWebHistory(),
  routes: [
    // {
    //     path: '/',
    //     name: 'home',
    //     component: () => import('../views/home/index.vue'),
    //     meta: {
    //         title: "主页",
    //         path: "/home",
    //     },
    // },
    // {
    //   path: "/login",
    //   name: "login",
    //   component: () => import("../views/user/login/index.vue"),
    //   meta: {
    //     title: "登录/注册",
    //     path: "/login",
    //   },
    // },
    {
      path: "/home",
      name: "home",
      component: () => import("../views/home/index.vue"),
      meta: {
        title: "主页",
        path: "/home",
      },
    },
    {
      path: "/",
      name: "/login",
      component: () => import("../views/user/login/index.vue"),
      meta: {
        title: "登录/注册",
        path: "/login",
      },
    },
    {
      path: "/error404",
      name: "error404",
      component: () => import("../views/user/error/404.vue"),
      meta: {
        title: "404",
        path: "/error404",
      },
    },
    {
      path: "/music",
      name: "music",
      component: () => import("../views/music/Music.vue"),
      meta: {
        title: "弹奏页面",
        path: "/music",
      },
    },
    {
      path: "/onautdio",
      name: "onautdio",
      component: () => import("../views/music/musicplay.vue"),
      meta: {
        title: "试听页面",
        path: "/onautdio",
      },
    },
  ],
});

export default router;
